load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//pkg/testutils:buildutil/buildutil.bzl", "disallowed_imports_test")

go_library(
    name = "execgen_lib",
    srcs = [
        "agg_gen_util.go",
        "and_or_projection_gen.go",
        "any_not_null_agg_gen.go",
        "avg_agg_gen.go",
        "bool_and_or_agg_gen.go",
        "cast_gen.go",
        "cast_gen_util.go",
        "concat_agg_gen.go",
        "const_gen.go",
        "count_agg_gen.go",
        "crossjoiner_gen.go",
        "data_manipulation_gen.go",
        "datum_to_vec_gen.go",
        "default_agg_gen.go",
        "default_cmp_expr_gen.go",
        "default_cmp_proj_ops_gen.go",
        "default_cmp_sel_ops_gen.go",
        "distinct_gen.go",
        "first_last_nth_value_gen.go",
        "hash_aggregator_gen.go",
        "hash_utils_gen.go",
        "hashjoiner_gen.go",
        "hashtable_gen.go",
        "is_null_ops_gen.go",
        "lead_lag_gen.go",
        "like_ops_gen.go",
        "main.go",
        "mergejoinbase_gen.go",
        "mergejoiner_gen.go",
        "min_max_agg_gen.go",
        "min_max_removable_agg_gen.go",
        "ntile_gen.go",
        "ordered_synchronizer_gen.go",
        "overloads_abbr.go",
        "overloads_base.go",
        "overloads_bin.go",
        "overloads_cmp.go",
        "overloads_gen_util.go",
        "overloads_hash.go",
        "projection_ops_gen.go",
        "range_offset_handler_gen.go",
        "rank_gen.go",
        "relative_rank_gen.go",
        "row_number_gen.go",
        "rowtovec_gen.go",
        "select_in_gen.go",
        "selection_ops_gen.go",
        "sort_gen.go",
        "sorttopk_gen.go",
        "span_encoder_gen.go",
        "substring_gen.go",
        "sum_agg_gen.go",
        "values_differ_gen.go",
        "vec_comparators_gen.go",
        "vec_gen.go",
        "vec_to_datum_gen.go",
        "window_aggregator_gen.go",
        "window_framer_gen.go",
        "window_peer_grouper_gen.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen/cmd/execgen",
    visibility = ["//visibility:private"],
    deps = [
        "//pkg/col/typeconv",
        "//pkg/sql/colexec/execgen",
        "//pkg/sql/colexecerror",
        "//pkg/sql/sem/tree/treebin",
        "//pkg/sql/sem/tree/treecmp",
        "//pkg/sql/sem/tree/treewindow",
        "//pkg/sql/types",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_gostdlib//x/tools/imports",
    ],
)

go_binary(
    name = "execgen",
    embed = [":execgen_lib"],
    gotags = ["metamorphic_disable"],
    visibility = ["//visibility:public"],
)

disallowed_imports_test(
    "execgen",
    [
        "//pkg/roachpb",
        "//pkg/sql/catalog",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/sem/tree",
    ],
)
